#!/usr/bin/env node

const http = require('http');

http.createServer((req, res) => {
    console.log('HTTP request method:', req.method);
    switch(req.method){
      case 'GET':
        res.end('get method');
        break;

      case 'POST':
        res.end('post method');
        break;

      case 'PUT':
        res.end('put method');
        break;

      case 'DELETE':
        red.end('delete method');
        break;

      default:
        res.end(`${res.method} method`);
    }

}).listen(8080)
